package xps.and.uudaijia.userclient.view.activity;

import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.ToggleButton;

import com.zhy.autolayout.AutoRelativeLayout;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import xps.and.uudaijia.userclient.R;
import xps.and.uudaijia.userclient.view.base.BaseActivity;

/**
 * Created by XPS on 2017/6/26.
 */

public class ActivityCancelOrder extends BaseActivity {
    @BindView(R.id.actionbar_iv_back)
    ImageView actionbarIvBack;
    @BindView(R.id.actionbar_tv_title)
    TextView actionbarTvTitle;
    @BindView(R.id.actionbar_tv_right)
    TextView actionbarTvRight;
    @BindView(R.id.v_gap_line)
    View vGapLine;
    @BindView(R.id.actionbar_al)
    AutoRelativeLayout actionbarAl;
    @BindView(R.id.tb_reason_1)
    ToggleButton tbReason1;
    @BindView(R.id.tb_reason_2)
    ToggleButton tbReason2;
    @BindView(R.id.tb_reason_3)
    ToggleButton tbReason3;
    @BindView(R.id.tb_reason_4)
    ToggleButton tbReason4;
    @BindView(R.id.et_reason)
    EditText etReason;
    @BindView(R.id.bt_confirm)
    Button btConfirm;

    ArrayList<ToggleButton> tbs = new ArrayList<>();

    @Override
    protected int getLayout() {
        return R.layout.activity_cancelorder;
    }

    @Override
    protected void setData() {

    }

//    String getCancelReason() {
//        StringBuilder cancelReson = new StringBuilder();
//
//        if (!TextUtils.isEmpty(etReason.getText().toString()))//如果自定义理由不为空 就直接返回自定义内容
//            return etReason.getText().toString();
//
//        for (ToggleButton tb : tbs) {
//            if (tb.isChecked())
//                cancelReson.append(tb.getTextOff());
//
//            if (!tb.getText().equals("暂时不想要司机"))//最后一个条目 就不添加分隔符
//                cancelReson.append(",");
//        }
//
//        return cancelReson.toString();
//    }

    @Override
    protected void init() {
        ButterKnife.bind(this);
        initTbs();
    }

    void initTbs() {
        tbs.add(tbReason1);
        tbs.add(tbReason2);
        tbs.add(tbReason3);
        tbs.add(tbReason4);
    }

    @OnClick({R.id.actionbar_iv_back, R.id.bt_confirm})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.actionbar_iv_back:
                break;
            case R.id.bt_confirm:
                //  Log.e("bt_confirm", getCancelReason());
                break;
        }
    }
}
